/*
 * @Author: wenqingwu 18417432@qq.com
 * @Date: 2023-07-11 15:26:00
 * @LastEditors: wenqingwu 18417432@qq.com
 * @LastEditTime: 2023-07-11 16:28:43
 * @FilePath: \w325coding-react\day104\router-v6\src\App.js
 * @Description: 配置react-router-dom v6.14.1 路由案例
 */
import routes from './router/router-config';
import { Routes, Route, Navigate, useRoutes } from 'react-router-dom'
function App() {
  return (
    // <>
    //   <Routes>
    //     <Route path="/" element={<Navigate to="/login" />} replace={true}></Route>
    //     <Route path="/login" element={<LoginView />} />
    //     <Route path="/home" element={<HomeView />}>
    //       {/* 添加子路由, path会自动与父级Path合并 , 不需要以"/"开始*/}
    //       <Route path="dept" element={<DeptView />}></Route>
    //       <Route path="roles" element={<RolesView />}></Route>
    //       <Route path="users" element={<UserView />}></Route>
    //       <Route path="course/:cid" element={<CourseView />} />
    //       {/* 默认子路由,添加index属性*/}
    //       <Route index element={<UserView />}></Route>
    //     </Route>

    //     {/* 404 */}
    //     <Route path='*' element={<Page404 />}></Route>
    //   </Routes>
    // </>

    <>
      {useRoutes(routes)}
    </>
  );
}

export default App;
